<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <script>
        var a = 1;
        var b = 2;
        // 根据上面两个变量，运用变量的赋值或计算，得出a=2;b=1
        /* 
            交换至思想
        */
       var c;
       c = a;   //1
       a = b;   //2
       b = c;   //1

       console.log(a,b);
    </script>
</body>

</html>